import { config } from '../config/index';
/**
 * @zh 获取图片信息
 * @param {String} src 图片的路径，可以是相对路径，临时文件路径，存储文件路径，网络图片路径
 * @return
 */
export const getImageInfo = (src: string): any => {
	return new Promise((resolve, reject) => {
		uni.getImageInfo({
			src: src,
			success: (res) => {
				if (config.debug) {
					console.warn(`image info debug: ${res}`);
				}
				resolve(res);
			},
			fail: (fail) => {
				reject(fail);
			}
		})
	});
}